package com.contact.util.util.conversion;

public class BooleanToStringConverter {
    private static final String NO = "N";
    private static final String YES = "Y";

    private String yesString;
    private String noString;

    /**
     * Initialize with Y for "yes" and N for "no"
     */
    public BooleanToStringConverter() {
        this(YES, NO);
    }

    public BooleanToStringConverter(String yesString, String noString) {
        super();
        this.yesString = yesString;
        this.noString = noString;
    }

    public String convertToString(Boolean value) {
        if (value == null) {
            return null;
        }
        return value ? yesString : noString;
    }

    public String getYesString() {
        return yesString;
    }

    public void setYesString(String yesString) {
        this.yesString = yesString;
    }

    public String getNoString() {
        return noString;
    }

    public void setNoString(String noString) {
        this.noString = noString;
    }

}
